home *** CD-ROM | disk | FTP | other *** search
Text File | 1998-06-21 | 4.2 KB | 170 lines | [TEXT/CWIE] |
- //===================================================================
- //======================= Headers =============================
-
- #include "AlertDialog.h"
- #include "GameUtilities.h"
- #include "Screen.h"
-
- //===================================================================
- //======================= Globals =============================
-
- //===================================================================
- //======================= #define =============================
-
-
- //===================================================================
- //======================= Function Prototypes =====================
-
- /*----------------------------------------------------------------------------\
-
- AlertDialog :: Constructor
-
- \----------------------------------------------------------------------------*/
- AlertDialog :: AlertDialog( void )
- : Window()
- {
-
- }
-
- /*----------------------------------------------------------------------------\
-
- AlertDialog :: SetDialog
-
- \----------------------------------------------------------------------------*/
- void AlertDialog :: SetDialog( char type , char *message , Boolean center )
- {
-
- }
-
- /*----------------------------------------------------------------------------\
-
- AlertDialog :: Init
-
- \----------------------------------------------------------------------------*/
- Boolean AlertDialog :: Init( void )
- {
- if( window.LoadPicBuff( 128 ) )
- {
- screenLoc.left = 0;
- screenLoc.top = 0;
- screenLoc.right = width = window.GetBoundsSize().right;
- screenLoc.bottom = height = window.GetBoundsSize().bottom;
-
- return true;
- }
-
- return false;
- }
-
- /*----------------------------------------------------------------------------\
-
- AlertDialog :: HandleMouseClick
-
- \----------------------------------------------------------------------------*/
- void AlertDialog :: HandleMouseClick( Boolean down , point where )
- {
- if( down )
- {
- draging = true;
- start = where;
- }
- else
- {
- if( draging )
- {
- screen.AddRectToUpdate( screenLoc );
-
- MyOffSetRect( &screenLoc , where.x - start.x , where.y - start.y );
-
- screen.AddRectToUpdate( screenLoc );
-
- draging = false;
- }
- }
- }
-
- /*----------------------------------------------------------------------------\
-
- AlertDialog :: HandleMouseMove
-
- \----------------------------------------------------------------------------*/
- void AlertDialog :: HandleMouseMove( point where )
- {
- if( draging )
- {
- screen.AddRectToUpdate( screenLoc );
-
- MyOffSetRect( &screenLoc , where.x - start.x , where.y - start.y );
- start = where;
-
- screen.AddRectToUpdate( screenLoc );
- }
- }
-
- /*----------------------------------------------------------------------------\
-
- AlertDialog :: PointInWindow
-
- - just saids if the point it inside the window area or not
- \----------------------------------------------------------------------------*/
- Boolean AlertDialog :: PointInWindow( point where )
- {
- return SectPtRect( where , screenLoc );
- }
-
- /*----------------------------------------------------------------------------\
-
- AlertDialog :: Active
-
- \----------------------------------------------------------------------------*/
- Boolean AlertDialog :: Front( void )
- {
- return( front );
- }
-
- /*----------------------------------------------------------------------------\
-
- AlertDialog :: SetFront
-
- \----------------------------------------------------------------------------*/
- void AlertDialog :: SetFront( Boolean f )
- {
- if( f != front )
- {
- front = f;
- screen.AddRectToUpdate( screenLoc );
- }
- }
-
- /*----------------------------------------------------------------------------\
-
- AlertDialog :: DrawToScreen
-
- \----------------------------------------------------------------------------*/
- void AlertDialog :: DrawToScreen( rect *where , Boolean backGround )
- {
- if( front )
- {
- if( where == NULL )
- {
- screen.DrawGeneric( &window , &window.GetBoundsSize() , &screenLoc ,
- NULL , 0 , 0 , 0 );
- }
- else
- {
- screen.DrawGeneric( &window , &window.GetBoundsSize() , &screenLoc ,
- where , 0 , 0 , 0 );
- }
- }
- else
- {
- if( where == NULL )
- {
- screen.DrawGeneric( &window , &window.GetBoundsSize() , &screenLoc ,
- NULL , kDrawTint , 16 , 0xffff );
- }
- else
- screen.DrawGeneric( &window , &window.GetBoundsSize() , &screenLoc ,
- where , kDrawTint , 16 , 0xffff );
- }
- }